package com;

import com.i2p.commons.mail.EmailConfig;
import com.i2p.commons.mail.EmailUtil;

/**
 * 邮件发送
 * @author swp
 * @create 2017-03-06 15:35
 **/
public class SendEmail {

    public void SendEmail() {

        /**
         * 邮件发送信息封装
         */
        EmailConfig config = new EmailConfig();;
        // 是否需要验证，true为需要，false为不需要
        config.setValidate(true);
        // 设置服务器
//        config.setMailServerHost(getSendEmailEntity.getSmtp());
//        config.setMailServerPort("25");
//        config.setUserName(getSendEmailEntity.getEmail());
//        config.setNickname(getSendEmailEntity.getNickname());
//        config.setPassword(getSendEmailEntity.getPassword());
//        config.setFromAddress(getSendEmailEntity.getEmail());
//        config.setToAddress(vo.getEmail());
//        config.setSubject(vo.getTitle());
//        config.setContent(vo.getContents());
        // 采取html格式发送
        try {
            EmailUtil.sendHtmlMail(config);
        } catch (RuntimeException e) {
            e.printStackTrace();
        }
    }
}
